﻿%--------------------------------------------------------------------------
%   信号生成模板
%   qwe14789cn@gmail.com
%   20180308
%--------------------------------------------------------------------------
%   初始化
%--------------------------------------------------------------------------
clear;
clc;

%--------------------------------------------------------------------------
%   参数设置
%--------------------------------------------------------------------------
%   构造连续信号的Fs
%--------------------------------------------------------------------------
fs = 70e6;                                                                 %发射信号采样频率

%--------------------------------------------------------------------------
%   请将生成的发射波形保存为
%   sig1
%   sig2
%   对应信号时间长度为
%   Tp1
%   Tp2
%   脉冲重复时间为
%   PRT
%   信号带宽为
%   bw
%--------------------------------------------------------------------------
%   完成后请解除以下代码注释部分
%--------------------------------------------------------------------------
%   sig = [sig1;sig2;zeros(round((PRT-Tp1-Tp2)*fs),1)];


%--------------------------------------------------------------------------
%   可视化
%--------------------------------------------------------------------------
figure(1)
subplot(321)
plot(real(sig1));grid on;
subplot(322)
spectrogram(sig1,128,127,128,fs,'yaxis');
subplot(323)
plot(real(sig2));grid on;
subplot(324)
spectrogram(sig2,16,15,16,fs,'yaxis');
subplot(325)
plot(real(sig));grid on;
subplot(326)
spectrogram(sig,64,63,128,fs,'yaxis');

figure(2)
subplot(311)
plot(0:1/fs:PRT-1/fs,real(sig));grid on
subplot(312)
plot(t1,real(sig1));grid on
subplot(313)
plot(t2,real(sig2));grid on

fprintf('按照采样率 %d MHz 生成的连续信号->raw_signal\n',fs/1e6)
save P01_waveform.mat sig1 sig2 sig fs bw PRT Tp1 Tp2
